home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 2.iso / bin / okserver < prev    next >
Text File  |  1996-11-11  |  3KB  |  105 lines

  1. #!/bin/sh -p
  2. PATH="/usr/bsd:/bin:/usr/bin:/usr/sbin:/usr/bin/X11"
  3. export PATH
  4. #
  5. # Start and stop dt_oksvr(1M)
  6. #
  7. # Copyright 1988-1991 Silicon Graphics, Inc.
  8. # All rights reserved.
  9. #
  10. # This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  11. # the contents of this file may not be disclosed to third parties, copied or
  12. # duplicated in any form, in whole or in part, without the prior written
  13. # permission of Silicon Graphics, Inc.
  14. #
  15. # RESTRICTED RIGHTS LEGEND:
  16. # Use, duplication or disclosure by the Government is subject to restrictions
  17. # as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  18. # and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  19. # successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  20. # rights reserved under the Copyright Laws of the United States.
  21. #
  22. # $Revision: 1.4 $
  23.  
  24. #       This is the dt_oksvr startup script for The Developer Toolbox, 
  25. #       version 6.0 CD, released, April 1996.  The key to running 
  26. #       this script correctly is to always ensure the
  27. #
  28. #            OKSVR_ROOT
  29. #
  30. #       shell variable is defined to point to the absolute path location 
  31. #       where the "searchtools" directory exists.  By default this
  32. #       location is defined to be  "/CDROM/toolbox/searchtools".  If one
  33. #       is already running an HTTP server and wants to create a child 
  34. #       directory of the HTTP server's Document Root to place the 
  35. #       contents of this toolbox in, the OKSVR_ROOT variable, defined 
  36. #       below, will need to be redefined to properly point to the new 
  37. #       "active" location of the searchtools subtree.  For example, 
  38. #       suppose your HTTP server's Document Root is "/usr/local/www", 
  39. #       and a directory under this named "toolbox" is created to house 
  40. #       the contents of the v6.0 CD.  Then, the default OKSVR_ROOT 
  41. #       definition would change from
  42. #
  43. #            OKSVR_ROOT=/CDROM/toolbox/searchtools
  44. #
  45. #       to now be
  46. #
  47. #            OKSVR_ROOT=/usr/local/www/toolbox/searchtools
  48. #
  49.  
  50. if test $CDROM_ROOT; then
  51.     export CDROM_ROOT
  52. else
  53.     CDROM_ROOT=/CDROM
  54.     export CDROM_ROOT
  55. fi
  56.  
  57. progdir=`dirname $0`
  58.  
  59. OKSVR=$progdir/dt_oksvr
  60. RM=/bin/rm
  61. GREP=/bin/grep
  62. ECHO=/bin/echo
  63. PS=/bin/ps
  64. OKSVR_ROOT=$HOME/$DT_WWW_ROOT/htdocs/toolbox/searchtools
  65.  
  66. if test $OKSVR_PORT; then
  67.     export OKSVR_PORT
  68. else
  69.     OKSVR_PORT=6004
  70.     export OKSVR_PORT
  71. fi
  72.  
  73. case $1 in
  74. 'start')
  75.     if test -x $OKSVR; then
  76.      if $PS -e 2>/dev/null | $GREP dt_oksvr | $GREP "-p $OKSVR_PORT" > /dev/null 2>&1 ; then
  77.             $ECHO "dt_oksvr (Search Server):        already running."
  78.             exit 1
  79.      else
  80.             if test -d $OKSVR_ROOT; then
  81.                 $ECHO "dt_oksvr (Search Server):        started"
  82.                 LD_LIBRARY_PATH=$progdir/lib; export LD_LIBRARY_PATH 
  83.                 FULPATH=$OKSVR_ROOT; export FULPATH
  84.                 $OKSVR -p $OKSVR_PORT &
  85.             else
  86.                 $ECHO "**** Error: dt_oksvr (Search Server): cannot locate Developer Toolbox Database"
  87.                 $ECHO "**** Please see sifttree.README at top-of-tree v6.0 Developer Toolbox CD"
  88.             fi
  89.      fi
  90.     else
  91.         $ECHO "dt_oksvr (Search Server):        not found ($OKSVR)."
  92.     fi
  93. ;;
  94.  
  95. 'stop')
  96.     /etc/killall -QUIT dt_oksvr    # send signal to kill
  97.     $RM -rf /usr/tmp/ft*    # get rid of temp files
  98.     $ECHO "dt_oksvr (Search Server):        stopped"
  99.     ;;
  100.  
  101. *)
  102.     echo "usage: $0 {start|stop}"
  103.     ;;
  104. esac
  105.